home *** CD-ROM | disk | FTP | other *** search
- Path: dartvax.dartmouth.edu!NewsWatcher!user
- From: Robert.Lendvai@dartmouth.edu (Robert Lendvai)
- Newsgroups: comp.lang.c++
- Subject: Re: class declaration question
- Date: Sun, 21 Jan 1996 01:26:28 -1000
- Organization: Dartmouth College
- Message-ID: <Robert.Lendvai-2101960127070001@129.170.80.94>
- References: <4dphp6$1bp@noc2.drexel.edu>
- NNTP-Posting-Host: atgw-kip-1-94.dartmouth.edu
-
- In article <4dphp6$1bp@noc2.drexel.edu>, st918h5w@dunx1.ocs.drexel.edu
- (Jonathan Juniman) wrote:
-
- > Is it necessary to do this:
- >
- > class SomeClass
- > {
- > public:
- > void Somefunction(int SomeParameter);
- > }
- >
- > or is it just as legal to do this:
- > class SomeClass
- > {
- > public:
- > void SomeFunction(int);
- > }
- >
- > The latter seems to be the convention, but why does the compiler need to
- > know the name of SomeFunction's argument? Isn't it sufficient to know the
- > type of Somefunction's argument (namely, int)?
- >
- > Please reply by e-mail. PS; thanks to all the people who answered my
- > overloaded operator question.
- >
- > Jon
-
- John,
-
- i think you need to go with the former (int SomeParameter). I'm not
- sure if the other way is legal, but even so, you need to know the name of
- the argument so that you may manipulate it in the function definition.
- Otherwise, how would you refer to the argument's value.
-